package com.panshi.service;

import com.panshi.entity.AppCommentT;
import com.panshi.entity.AppSearchT;
import com.panshi.service.impl.CommentClientServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@Service
@FeignClient(value = "HASBEI-COMMENT-PROVIDER-8005-XHLMR" ,fallbackFactory = CommentClientServiceFallbackFactory.class)
public interface CommentClientService {

    @ApiOperation("添加评论")
    @PostMapping("/app-comment-t/commAdd")
    public Boolean commAdd(AppCommentT appCommentT);

    @ApiOperation("按咨询表ID 查询咨询评论")
    @GetMapping("/app-comment-t/commZxId/{zxId}/{page}/{limit}")
    public List<AppCommentT> commZxId(@PathVariable int zxId, @PathVariable int page, @PathVariable int limit);

    @ApiOperation("查询评论的评论")
    @GetMapping("/app-comment-t/getCommById/{commId}")
    public List<AppCommentT> getCommById(@PathVariable int commId);

    @ApiOperation("分页搜索 模糊查询")
    @GetMapping("/app-search-t/searchPage/{page}/{limit}/{title}")
    public List<AppSearchT> searchPage(@PathVariable int page, @PathVariable int limit, @PathVariable String title);

    @ApiOperation("分页搜索")
    @GetMapping("/app-search-t/searchNew/{page}/{limit}")
    public List<AppSearchT> searchNew(@PathVariable int page,@PathVariable int limit);

    @ApiOperation("查询搜索数")
    @GetMapping("/app-search-t/searchCount/{title}")
    public Integer searchCount(@PathVariable String title);
}
